package itBean;
public class Account {
    private double id;
    private double balance;//余额
    private double yearRate;//年利率
    public Account(){
    }
    public Account(double id,double balance,double yearRate){
        this.id=id;
        this.balance=balance;
        this.yearRate=yearRate;
    }
    //取款方法 定义一个取款金额1000
    public void  withdraw(double money){
        if (money>balance){
            System.out.println("您的余额不足，取钱失败");
        }else {
            this.balance -=money;
            System.out.println("成功取出"+money);
        }
    }
    //存款方式
    public void deposit(double money1){
        this.balance +=money1;
        System.out.println("成功存入："+money1);
    }

    public double getId() {
        return id;
    }

    public void setId(double id) {
        this.id = id;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public double getYearRate() {
        return yearRate;
    }
    public void setYearRate(double yearRate) {
        this.yearRate = yearRate;
    }
}
